\(\int \frac {1}{\sqrt {-b x} \sqrt {2-b x}} \, dx\) [1546]

   Optimal result
   Rubi [A] (verified)
   Mathematica [B] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [C] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 19, antiderivative size = 20 \[ \int \frac {1}{\sqrt {-b x} \sqrt {2-b x}} \, dx=-\frac {2 \text {arcsinh}\left (\frac {\sqrt {-b x}}{\sqrt {2}}\right )}{b} \]

[Out]

-2*arcsinh(1/2*(-b*x)^(1/2)*2^(1/2))/b

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.105, Rules used = {65, 221} \[ \int \frac {1}{\sqrt {-b x} \sqrt {2-b x}} \, dx=-\frac {2 \text {arcsinh}\left (\frac {\sqrt {-b x}}{\sqrt {2}}\right )}{b} \]

[In]

Int[1/(Sqrt[-(b*x)]*Sqrt[2 - b*x]),x]

[Out]

(-2*ArcSinh[Sqrt[-(b*x)]/Sqrt[2]])/b

Rule 65

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[{p = Denominator[m]}, Dist[p/b, Sub
st[Int[x^(p*(m + 1) - 1)*(c - a*(d/b) + d*(x^p/b))^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] &
& NeQ[b*c - a*d, 0] && LtQ[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntLinearQ[a,
b, c, d, m, n, x]

Rule 221

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Simp[ArcSinh[Rt[b, 2]*(x/Sqrt[a])]/Rt[b, 2], x] /; FreeQ[{a, b},
 x] && GtQ[a, 0] && PosQ[b]

Rubi steps \begin{align*} \text {integral}& = -\frac {2 \text {Subst}\left (\int \frac {1}{\sqrt {2+x^2}} \, dx,x,\sqrt {-b x}\right )}{b} \\ & = -\frac {2 \sinh ^{-1}\left (\frac {\sqrt {-b x}}{\sqrt {2}}\right )}{b} \\ \end{align*}

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(52\) vs. \(2(20)=40\).

Time = 0.01 (sec) , antiderivative size = 52, normalized size of antiderivative = 2.60 \[ \int \frac {1}{\sqrt {-b x} \sqrt {2-b x}} \, dx=-\frac {4 \sqrt {x} \arctan \left (\frac {\sqrt {b} \sqrt {x}}{\sqrt {2}-\sqrt {2-b x}}\right )}{\sqrt {b} \sqrt {-b x}} \]

[In]

Integrate[1/(Sqrt[-(b*x)]*Sqrt[2 - b*x]),x]

[Out]

(-4*Sqrt[x]*ArcTan[(Sqrt[b]*Sqrt[x])/(Sqrt[2] - Sqrt[2 - b*x])])/(Sqrt[b]*Sqrt[-(b*x)])

Maple [A] (verified)

Time = 0.54 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.35

method result size
meijerg \(\frac {2 \sqrt {x}\, \arcsin \left (\frac {\sqrt {b}\, \sqrt {x}\, \sqrt {2}}{2}\right )}{\sqrt {b}\, \sqrt {-b x}}\) \(27\)
default \(\frac {\sqrt {-b x \left (-b x +2\right )}\, \ln \left (\frac {b^{2} x -b}{\sqrt {b^{2}}}+\sqrt {b^{2} x^{2}-2 b x}\right )}{\sqrt {-b x}\, \sqrt {-b x +2}\, \sqrt {b^{2}}}\) \(64\)

[In]

int(1/(-b*x)^(1/2)/(-b*x+2)^(1/2),x,method=_RETURNVERBOSE)

[Out]

2/b^(1/2)/(-b*x)^(1/2)*x^(1/2)*arcsin(1/2*b^(1/2)*x^(1/2)*2^(1/2))

Fricas [A] (verification not implemented)

none

Time = 0.23 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.35 \[ \int \frac {1}{\sqrt {-b x} \sqrt {2-b x}} \, dx=-\frac {\log \left (-b x + \sqrt {-b x + 2} \sqrt {-b x} + 1\right )}{b} \]

[In]

integrate(1/(-b*x)^(1/2)/(-b*x+2)^(1/2),x, algorithm="fricas")

[Out]

-log(-b*x + sqrt(-b*x + 2)*sqrt(-b*x) + 1)/b

Sympy [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 0.69 (sec) , antiderivative size = 51, normalized size of antiderivative = 2.55 \[ \int \frac {1}{\sqrt {-b x} \sqrt {2-b x}} \, dx=\begin {cases} - \frac {2 \operatorname {acosh}{\left (\frac {\sqrt {2} \sqrt {b} \sqrt {x}}{2} \right )}}{b} & \text {for}\: \left |{b x}\right | > 2 \\- \frac {2 i \operatorname {asin}{\left (\frac {\sqrt {2} \sqrt {b} \sqrt {x}}{2} \right )}}{b} & \text {otherwise} \end {cases} \]

[In]

integrate(1/(-b*x)**(1/2)/(-b*x+2)**(1/2),x)

[Out]

Piecewise((-2*acosh(sqrt(2)*sqrt(b)*sqrt(x)/2)/b, Abs(b*x) > 2), (-2*I*asin(sqrt(2)*sqrt(b)*sqrt(x)/2)/b, True
))

Maxima [A] (verification not implemented)

none

Time = 0.20 (sec) , antiderivative size = 32, normalized size of antiderivative = 1.60 \[ \int \frac {1}{\sqrt {-b x} \sqrt {2-b x}} \, dx=\frac {\log \left (2 \, b^{2} x + 2 \, \sqrt {b^{2} x^{2} - 2 \, b x} b - 2 \, b\right )}{b} \]

[In]

integrate(1/(-b*x)^(1/2)/(-b*x+2)^(1/2),x, algorithm="maxima")

[Out]

log(2*b^2*x + 2*sqrt(b^2*x^2 - 2*b*x)*b - 2*b)/b

Giac [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 23, normalized size of antiderivative = 1.15 \[ \int \frac {1}{\sqrt {-b x} \sqrt {2-b x}} \, dx=\frac {2 \, \log \left (\sqrt {-b x + 2} - \sqrt {-b x}\right )}{b} \]

[In]

integrate(1/(-b*x)^(1/2)/(-b*x+2)^(1/2),x, algorithm="giac")

[Out]

2*log(sqrt(-b*x + 2) - sqrt(-b*x))/b

Mupad [B] (verification not implemented)

Time = 0.30 (sec) , antiderivative size = 39, normalized size of antiderivative = 1.95 \[ \int \frac {1}{\sqrt {-b x} \sqrt {2-b x}} \, dx=-\frac {4\,\mathrm {atan}\left (\frac {b\,\left (\sqrt {2}-\sqrt {2-b\,x}\right )}{\sqrt {-b\,x}\,\sqrt {-b^2}}\right )}{\sqrt {-b^2}} \]

[In]

int(1/((-b*x)^(1/2)*(2 - b*x)^(1/2)),x)

[Out]

-(4*atan((b*(2^(1/2) - (2 - b*x)^(1/2)))/((-b*x)^(1/2)*(-b^2)^(1/2))))/(-b^2)^(1/2)